package ru.dc.object;

/**
 * Источник загрузки.
 * <pre>
 * User: Penkov Vladimir
 * Date: 01.11.2010
 * Time: 16:14:12
 * </pre>
 */
public class DownloadSource {

    private String nick;
    private ServerInfo hub;

    public ServerInfo getHub() {
        return hub;
    }

    public void setHub(ServerInfo hub) {
        this.hub = hub;
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DownloadSource that = (DownloadSource) o;

        if (nick != null ? !nick.equals(that.nick) : that.nick != null) return false;
        if (hub != null ? !hub.equals(that.hub) : that.hub != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = nick != null ? nick.hashCode() : 0;
        result = 31 * result + (hub != null ? hub.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "DownloadSource{" +
                ", nick=" + nick +
                ", hub=" + hub +
                '}';
    }
}
